package com.lingying.caiwudailikehudaun.utils;

import java.util.List;

//集合分页
public class JavaPageUtil {

    public static List fenye(Integer page, Integer limit, List list) {
        int toIndex;
        if (page * limit < list.size()) {
            toIndex = page * limit;
        } else {
            toIndex = list.size();
        }
        List result = list.subList((page - 1) * limit, toIndex);
        return result;
    }
}
